package com.lins.framework.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Admin on 2017/5/8.
 */

public class Validator {
    public static boolean isEmpty(String Value) {
        return (Value == null || Value.trim().equals(""));
    }

    public static boolean isEmpty(Object Value) {
        if (Value == null)
            return true;
        else
            return false;
    }


    /**
     * @param str 身份证号码
     * @return
     */
    public static boolean isIdentityCard(String str) {
        Pattern pattern = Pattern.compile("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0-2]\\d)|(3[0-1]))\\d{3}([0-9]|X|x)$");
        Matcher matcher = pattern.matcher(str);
        boolean res = matcher.matches();
        return res;

    }
}
